//
//  KRLTimelineVLogCell.m
//  KaraLive
//
//  Created by Zhijia Zhong on 2018/9/15.
//  Copyright © 2018年 naxigoren. All rights reserved.
//

#import "KRLTimelineVLogCell.h"
#import "KRLTypeView.h"

@implementation KRLTimelineVLogCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self.contentView addSubview:self.playView];
        [self.contentView addSubview:self.typeView];
    }
    return self;
}

- (void)updateConstraints {
    [self.playView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.thumbView.mas_centerX);
        make.centerY.equalTo(self.thumbView.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(60, 60));
    }];
    
    [self.typeView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.thumbView);
        make.top.mas_equalTo(self.thumbView).offset(16);
        make.height.mas_equalTo(18);
    }];

    [super updateConstraints];
}

- (void)updateCellWithModel:(KRLTimelineModel *)model {
    [super updateCellWithModel:model];
    
    self.typeView.type = model.type;
}

@end
